An example way of adding a VarietyExtension using an XML patch.
Explanation of the values included as comments inside of the extension below.

<Operation Class="PatchOperationAddModExtension">
    <xpath>Defs/ThingDef[defName="MyCustom"]</xpath>
    <value>
        <li Class="VarietyMattersMoreCompat.VarietyExtension">
            <!-- Default is false. Variety Matters discards anything marked RawBad or worse. -->
            <!-- Changing any default value (like setting dessert quality 0 or higher) is going to be added to variety no matter the FoodPreferability. -->
            <!-- this option mostly exists if the food is not a dessert and not archotech.. -->
            <ignoreFoodPreferability>true</ignoreFoodPreferability>
            <!-- Default is false. If true the meal will be treated as archotech meal, adding additional variety. -->
            <isArchotech>true</isArchotech>
            <!-- Default is -1, which means not a dessert. A value of 0 or higher will mean that it's a dessert. Values of -2 or lower are disallowed (shows an error). -->
            <!-- Higher quality desserts will grant extra variety from consuming them (currently bonuses for quality 2 and 3 or higher). -->
            <dessertQuality>1</dessertQuality>
        </li>
    </value>
</Operation>